package com.csii.user.service.impl;

import com.csii.core.api.Result;
import com.csii.core.system.vo.ComboModel;
import com.csii.core.system.vo.SysPermissionDataRuleModel;
import com.csii.core.system.vo.SysUserCacheInfo;
import com.csii.user.controller.SysDepartController;
import com.csii.user.controller.SysPermissionController;
import com.csii.user.controller.SysRoleController;
import com.csii.user.controller.SysUserController;
import com.csii.user.entity.SysDepart;
import com.csii.user.entity.SysRole;
import com.csii.user.entity.SysUser;
import com.csii.user.service.ISysUserBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SysUserBaseServiceImpl implements ISysUserBaseService {

    @Autowired
    private SysUserController sysUserController;
    @Autowired
    private SysDepartController sysDepartController;
    @Autowired
    private SysPermissionController sysPermissionController;
    @Autowired
    private SysRoleController sysRoleController;

    @Override
    public SysUser getUserByName(String userName) {
        return sysUserController.getUserByName(userName);
    }

    @Override
    public List<SysUser> getUserAll(List<String> userNameList) {
        return sysUserController.getUserAll(userNameList);
    }

    @Override
    public List<SysUser> selectAllList() {
        return sysUserController.selectAllList();
    }

    @Override
    public Result<SysUser> queryById(String id) {
        return sysUserController.queryById(id);
    }

    @Override
    public Result<List<SysDepart>> listUserDepartList(String userId) {
        return sysUserController.listUserDepartList(userId);
    }

    @Override
    public Map<String, String> loginByPassword(String grantType, String userName, String passWord, String authorization) {
        return null;
    }

    @Override
    public Map<String, String> loginByCode(String grantType, String code, String redirectUri, String authorization) {
        return null;
    }

    @Override
    public String refreshToken(String grantType, String refreshToken, String authorization) {
        return null;
    }

    @Override
    public String checkToken(String token, String authorization) {
        return null;
    }

    @Override
    public Result<List<SysPermissionDataRuleModel>> listDataRuleByUrl(String requestPath, String requestMethod, String component) {
        return sysPermissionController.listDataRuleByUrl(requestPath, requestMethod, component);
    }

    @Override
    public Result<SysUserCacheInfo> getCacheUser(String username) {
        return sysUserController.getCacheUser(username);
    }

    @Override
    public List<ComboModel> queryAllUser() {
        return sysUserController.queryAllUser();
    }

    @Override
    public List<SysUser> getUsersByName(String name) {
        return sysUserController.getUsersByName(name);
    }

    @Override
    public List<String> getDepartIdsByUsername(String userName) {
        return sysDepartController.getDepartIdsByUsername(userName);
    }

    @Override
    public List<String> getDepartNamesByUsername(String userName) {
        return sysDepartController.getDepartNamesByUsername(userName);
    }

    @Override
    public Result<List<SysDepart>> getDepartmentListAndUserIds() {
        return sysDepartController.getDepartmentListAndUserIds();
    }

    @Override
    public Result<SysUser> getUsersAndDepartId(String userId) {
        return sysUserController.getUsersAndDepartId(userId);
    }

    @Override
    public Result<List<SysUser>> getUserListByName(String name) {
        return sysDepartController.getUserListByName(name);
    }

    @Override
    public Result<List<SysDepart>> queryDeptLikeDeptName(String deptName) {
        return sysDepartController.queryDeptLikeDeptName(deptName);
    }

    @Override
    public Result<List<String>> queryDeptCodeByUserId(String userId) {
        return sysDepartController.queryDeptCodeByUserId(userId);
    }

    @Override
    public Result<List<SysDepart>> queryDeptByDeptCodes(List<String> deptCodes) {
        return sysDepartController.queryDeptByDeptCodes(deptCodes);
    }

    @Override
    public Result<List<String>> queryRoleCodeByUserId(String userId) {
        return sysRoleController.queryRoleCodeByUserId(userId);
    }

    @Override
    public Result<List<SysRole>> queryRoleLikeRoleName(String roleName) {
        return sysRoleController.queryRoleLikeRoleName(roleName);
    }

    @Override
    public Result<List<SysRole>> queryRoleByRoleCodes(List<String> roleCodes) {
        return sysRoleController.queryRoleByRoleCodes(roleCodes);
    }

    @Override
    public Result<List<SysUser>> queryUserLikeUsernameOrNickname(String usernameOrNickname) {
        return sysUserController.queryUserLikeUsernameOrNickname(usernameOrNickname);
    }

    @Override
    public Result<List<SysUser>> queryUserByUsernames(List<String> usernames) {
        return sysUserController.queryUserByUsernames(usernames);
    }

    @Override
    public Result<List<SysUser>> queryUserByRoleCode(String roleCode) {
        return sysUserController.queryUserByRoleCode(roleCode);
    }

    @Override
    public Result<List<SysUser>> queryHisLeadershipByUsername(String username) {
        return sysUserController.queryHisLeadershipByUsername(username);
    }
}
